package com.guoguo.service.impl;

import com.github.pagehelper.PageHelper;
import com.guoguo.base.PageBean;
import com.guoguo.entity.Orders;
import com.guoguo.entity.vo.OrdersVO;
import com.guoguo.mapper.OrdersMapper;
import com.guoguo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by KLSD on 2017/9/29.
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrdersMapper ordersMapper;


    @Override
    public PageBean<OrdersVO> selectOrdersList(int pageNumber, int pageSize) {
        PageHelper.startPage(pageNumber, pageSize);
        List<OrdersVO> ordersVOs=ordersMapper.selectOrdersList();
        return new PageBean<OrdersVO>(ordersVOs);
    }

    @Override
    public Orders selectByPrimaryKey(String orderNo) {
        return ordersMapper.selectByPrimaryKey(orderNo);
    }

    @Override
    public int updateByPrimaryKeySelective(Orders orders) {
        return ordersMapper.updateByPrimaryKeySelective(orders);
    }
}
